home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
mlapi.arc
/
MLAPI.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-28
|
3KB
|
133 lines
UNIT MLAPI; {MultiLink Advanced Interface}
{Version 1.0}
{
Donald M. DeLapp
485 S. Sheridan Ave.
Sheridan, WY 82801
307-674-6841
MultiLink has more functions than this,
but these are all that I have used in my software
}
INTERFACE
USES Dos;
FUNCTION MultiLinkLoaded : BOOLEAN;
{
returns true if MultiLink is installed
}
PROCEDURE Enque( What : INTEGER;
Wait : BOOLEAN;
VAR Result : INTEGER );
{
enques resource identified by What
(system maximum of 100 resources enqued at one time)
if Wait is TRUE will not return until resource is available
Result 0 = resource enqued
1 = resource not available
2 = user error
}
PROCEDURE Deque( What : INTEGER;
VAR Result : INTEGER );
{
deques resource identified by What
(even if resource was enqued by another task)
Result 0 = resource dequed
2 = user error
}
PROCEDURE SetTaskPriority( N : INTEGER );
{
sets task priority of the current task (N = 0..7)
}
PROCEDURE SetKbdTest( N : INTEGER );
{
sets task status for the current task if
application is repeatedly testing the keyboard
}
CONST
{ Constants for setting keyboard test }
DIS = 1; {disable until keyboard input detected}
NODIS = 0; {normal}
NVDIS = 255; {never disable}
FUNCTION MLVIDRAMActive : BOOLEAN;
{
returns TRUE if MLVIDRAM is active
}
FUNCTION GetMultiLinkVideoSegment : WORD;
{
returns segment address of MLVIDRAM video buffer for the current partition,
direct video access should go here for a terminal, BIOS video access faster
unless using 286 with memory management unit
}
PROCEDURE SetTaskTimeSlice( N : INTEGER );
{
sets task time slice for the current task (N = 1..18)
}
FUNCTION GetPartitionNo : INTEGER;
{
returns partition number of the current task
}
PROCEDURE TaskSwitch;
INLINE($B4/$02/ {MOV AH,2}
$CD/$7F {INT 7Fh });
{
yield
not necessary when MLSLICE is used, but helpful in keeping a
disk intensive task from taking too much time from other tasks
}
IMPLEMENTATION
{$L MLAPI.OBJ}
FUNCTION MultiLinkLoaded : BOOLEAN; EXTERNAL;
PROCEDURE Enque( What : INTEGER;
Wait : BOOLEAN;
VAR Result : INTEGER ); EXTERNAL;
PROCEDURE Deque( What : INTEGER;
VAR Result : INTEGER ); EXTERNAL;
PROCEDURE SetTaskPriority( N : INTEGER ); EXTERNAL;
PROCEDURE SetKbdTest( N : INTEGER ); EXTERNAL;
FUNCTION MLVIDRAMActive : BOOLEAN; EXTERNAL;
FUNCTION GetMultiLinkVideoSegment : WORD; EXTERNAL;
PROCEDURE SetTaskTimeSlice( N : INTEGER ); EXTERNAL;
FUNCTION GetPartitionNo : INTEGER; EXTERNAL;
END.